# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-cymon
pkgname=('python2-cymon' 'python-cymon')
_pkgname=cymon
pkgver=0.1
pkgrel=9
pkgdesc='API wrapper for Cymon.io.'
arch=('any')
url='https://pypi.org/project/cymon/#files'
license=('custom:unknown')
depends=('python2' 'python2-requests')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f4ba87e6ea538388c6f8087471802c914427c5cfbdf3ffa667b2e3a9b08c8134c4b6beba40bcfd8f86b212b8bb77c23c830f270904f6347868851093a9e85089')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-cymon() {
  depends=('python2' 'python2-requests')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-cymon() {
  depends=('python' 'python-requests')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

